MAP PROJECTIONS IN R

Hilary Dugan
Feb 5, 2016

Why maps are wrong

Watch VOX video

  • Surface of the Earth cannot be represented as a plane without distortion
  • Projections are just algorithms to move from sphere to plane
  • Maps are data visualization at its best

Plotting maps in R

library(maps)

Plotting maps in R

 ?map
  • database: string
    • 'world', 'usa', 'state'
  • regions: string vector of regions in database
    • 'Canada' or 'California'
  • projection: see ?mapproject
  • parameters: see ?mapproject

Plotting maps in R

 ?map
  • orientation: where the map should be centered
    • c(latitude, longitude, rotation)
  • fill: draw lines or fill area
    • TRUE or FALSE
  • wrap: lines that cross too far across the map (due to a strange projection) are omitted*
    • TRUE or FALSE

Plotting maps in R

 ?map
  • xlim: range of longitudes
    • c(40,60)
  • ylim: range of latitudes
  • mar: default margins allow for axes
    • c(0,0,0,0)

Plotting maps in R

map('world',col='red4',mar=c(0,0,0,0)) #Default is albers equal-area

plot of chunk unnamed-chunk-6

Plotting maps in R

map('world', col='red4', mar=c(0,0,0,0))
map('world', regions = c('Ireland','Canada','Antarctica'), add=T, col='grey50', fill = T, border=F)

plot of chunk unnamed-chunk-7

Plotting maps in R

map('state', col='red4', mar=c(0,0,0,0))
map('state', regions = c('Wisconsin','California'), add=T, col='grey50', fill = T, border=F)

plot of chunk unnamed-chunk-8

Types of Projections


By surface

  • Cylindrical
  • Pseudocylindrical
  • Conic
  • Azimuthal


By property

  • Conformal
    • preserve angles locally
  • Equal-area
  • Equidistant
  • Gnomonic
    • Great circles are straight lines
  • or Compromise (Robinson or Winkel-Tripel)

Cylindrical Map Projections


  • Straight coordinate lines
  • Horizontal parallels crossing vertical meridians at right angles
  • Can change scale used when spacing the parallel lines



text - Mercator, Behrmann, Gall-Peters

Maps - cylindrical equal-area (Lambert)

map('world', col='red4', proj='cylequalarea', parameters=0, wrap=T,fill=T) # Lambert

N-S compression = cosine of the latitude (reciprocal of E-W stretching). Preserves area. plot of chunk unnamed-chunk-10

Maps - cylindrical equal-area (Gall-Peters)

map('world', col='red4', proj='cylequalarea', parameters=45, wrap=T,fill=T) # Gall-Peters

N-S compression = cosine of the latitude (reciprocal of E-W stretching). Preserves area. plot of chunk unnamed-chunk-12

Pseudocylindrical Projections


  • Central meridian is a straight line
  • Other meridians bow outward
  • Parallels are straight lines



text

Pseudocylindrical in R - Mollweide (World)

map('world', col='red4', proj='mollweide', res=0, fill=T, orientation = c(90,0,0))

plot of chunk unnamed-chunk-13

Conic Projections


  • Meridians are mapped to equally spaced lines radiating from apex
  • Latitudes are mapped to circular arcs centered on the apex
  • Pick two standard parallels
    • Where cone intersects globe
    • Low distortion in scale, shape, and area near standard parallels
  • Best suited regional maps


text

Conic Map Projections

  • Equidistant conic
    • parallels evenly spaced along the meridians to preserve a constant distance scale along each meridian
  • Albers conic
    • adjusts the north-south distance between non-standard parallels to compensate for the east-west stretching or compression, giving an equal-area map
  • Lambert conformal conic
    • adjusts the north-south distance between non-standard parallels to equal the east-west stretching, giving a conformal map

Conic - Equidistant conic (World)

map('world', col='red4', proj='simpleconic', parameters=c(20,50), res=0, orientation = c(90,0,0))

plot of chunk unnamed-chunk-14

Conic maps in R - USA

plot of chunk unnamed-chunk-15

Conic maps in R - Albers (USA)

map('state',col='red4',proj='albers',parameters =c(30,50))
map('state',col='red4',proj='albers',parameters =c(10,70),add=T,fill=T)

plot of chunk unnamed-chunk-17

Conic vs. Cylindrical - USA

plot of chunk unnamed-chunk-18

Azimuthal (Planar) Map Projections


  • Mapping of radial lines can be visualized as a plane tangent to the Earth, with the central point as tangent point
  • Great circles through the central point are represented by straight lines on the map



text

Azimuthal (Planar) - Gnomonic

map('world', col='red4', proj='simpleconic', parameters=c(20,50), res=0, orientation = c(90,0,0))

May be the oldest map projection, from 6th century BC plot of chunk unnamed-chunk-19

Plotting the poles

map('world', projection = 'orthographic', orientation = c(90,0,0))

plot of chunk unnamed-chunk-20

map('world', projection = 'orthographic', orientation = c(-90,0,0))

plot of chunk unnamed-chunk-21

What's next?


  • Add point data
  • Add regional data

salt map

References and Learning Material


xkcd